package com.yzy.mall.app

import com.decard.NDKMethod.BasicOper
import com.jeremyliao.liveeventbus.LiveEventBus
import com.yzy.baselibrary.app.BaseApplication
import com.yzy.baselibrary.http.RetrofitConfig
import com.yzy.mall.constants.ApiConstants
import com.yzy.mall.http.RequestIntercept


class App : BaseApplication(){
    override fun initInMainThread() {
        initLiveBus()
        RetrofitConfig {
            context = this@App
            baseUrl = ApiConstants.Address.BASE_URL
            interceptors.add(RequestIntercept())
        }
        BasicOper.dc_AUSB_ReqPermission(this);
    }

    override fun baseInitCreate() {
    }


    private fun initLiveBus() {
        LiveEventBus
            .config()
            .supportBroadcast(this)
            .lifecycleObserverAlwaysActive(true)
            .autoClear(false)
    }
}

